@primary: rgb(114, 120, 191);
@secondary: rgb(114, 191, 133);
@subheaders: #444;
@fonts: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace;

body {
	margin: 0;
	padding: 0;
	font-size: 100%;
	font-family: @fonts;
	color: #111;
	
	h1 {
		a {
			color: black;
			.transition-duration(0.2s);
			&:hover {
				color: #303030;
			}
		}
	}
	h1, h2, h3 {
		line-height: 1.2;
	}

	header {
		margin: 0 auto;
		padding: 1.15em;
		
		h1 {
			display: inline;
		}
		a {
			margin: 0 0 0 1em;
			&:link, &:visited {
				color: blue;
			}
			&.no {
				text-decoration: line-through;
				color: #bdbdbd;
				cursor: default;
			}
		}
		nav {
			display: inline;
			margin: 0 1em;
			line-height: 2.4em;
			span, a {
				margin: 0 0 0 1em;
			}
			a, a:link, a:visited {
				color: #999;
				&.current {
					color: #666;
					text-decoration: underline;
					cursor: default;
				}
			}
		}
	}
	&#promo {
		div.heading {
			margin: 8em 0;
		}
		div.heading, div.attention-form {
			h1 {
				font-size: 3.5em;
			}
			input {
				padding-left: 0.75em;
				padding-right: 0.75em;
				.rounded(.25em);
				&[type=email] {
					max-width: 16em;
				}
				&[type=submit] {
					padding-left: 1.5em;
					padding-right: 1.5em;
					.transition(0.2s);
					&:hover {
						background-color: lighten(@primary, 3%);
					}
				}
			}
		}
		h2 {
			margin-bottom: 0;
			font-size: 1.8em;
			font-weight: normal;
			span.write-as {
				color: black;
			}
			&.soon {
				color: lighten(@subheaders, 50%);
				span {
					&.write-as {
						color: lighten(#000, 50%);
					}
					&.note {
						color: lighten(#333, 50%);
						font-variant: small-caps;
						margin-left: 0.5em;
					}
				}
			}
		}
		.half-col a + a {
			margin-left: 2em;
		}
	}

	footer {
		text-align: center;
		padding: 0 2em;
		margin-bottom: 4em;

		a {
			text-decoration: none;
			.transition-duration(0.2s);
			-moz-transition-property: color;
			-webkit-transition-property: color;
			-o-transition-property: color;
			transition-property: color;

			+ a {
				margin-left: 0.8em;
			}
			&:link, &:visited {
				color: #888;
			}
			&:hover {
				color: #666;
			}
			&.home {
				color: #333;
				font-weight: bold;
				&:hover {
					color: #000;
				}
			}
		}
		nav {
			margin: 3em 0 2em;
		}

		.made-by {
			font-size: 0.86em;
			color: #aaa;
		}
	}
	&#neighborhood {
		ul {
			list-style: none;
			padding: 0;
		}
		li:before {
			content: "\2302\A0";
		}
	}
}

.open-house {
	display: inline;
	margin: 2em;
	float: left;
	height: 295px;

	img {
		border: 1px solid #ccc;
		display: block;
		max-width: 320px;
		max-height: 240px;
		.opacity(.6);
		.transition-duration(0.3s);
	}
	a:hover img {
		.opacity(1);
	}

	.house-name {
		max-width: 320px;
		margin-top: 1em;
		font-size: 1.4em;
		text-align: center;
		display: block;
	}
}

#editor, #css-editor, .editor, #preview-wrap {
	position: absolute;
	top: 5em;
	bottom: 0;
	font-size: 1em;
	border-top: 1px solid #ccc;
}

#editor, #css-editor, .editor {
	border-right: 1px solid #ccc;
	right: 50%;
	left: 0;
}

#preview-wrap {
	left: 50%;
	right: 0;
	iframe {
		position: absolute;
		width: 100%;
		height: 100%;
		border: 0;
	}
}

#css-editor {
	right: 60%;
	&+ #preview-wrap {
		left: 40%;
	}
}

header {
	margin: 1em;
}

a {
	text-decoration: none;
	&:hover {
		text-decoration: underline;
	}
}

hr {
	border: 0;
	height: 1px;
	background: #ccc;
	max-width: 40em;
	margin: 4em auto;
	text-align: center;
}

pre, .hljs {
	margin: 0;
	padding: 0.5em 2em 1.5em;
	font-size: 1.2em;
}

input {
	padding: 0.5em;
	font-family: @fonts;
	&[type=submit] {
		border: 1px solid @primary;
		background: @primary;
		color: white;
	}
}

#official-writing, #wrapper {
	margin: 1em 2em 4em;
	font-size: 1.2em;
	
	h2, h3, h4 {
		color: @subheaders;
	}

	ul {
		margin: 0;
		padding: 0 0 0 1em;
		list-style-position: inside;
		line-height: 1.4;
		text-indent: -1em;
	}
}

#tools {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 1em 2em;
	
	.tool {
		display: inline-block;
		margin: 0 2em 0 0;
		
		&#status {
			color: #666;
			&.doing {
				font-style: italic;
			}
		}
	}
	.mode-wp {
		font-family: serif;
	}
	.mode-typewriter {
		font-family: @fonts;
	}
}
.clearfix {
	overflow: auto;
}
.half-col, .half {
	float: left;
	+ .half-col {
		margin-left: 4em;
	}
}
.half {
	width: 50%;
}

.hljs {
	overflow-x: inherit;
	background: transparent;
}

code {
	font-family: @fonts;
	font-size: 1em;
}

#wrapper {
	max-width: 50em;
}

.stat {
	display: inline-block;
	font-size: 1.2em;
	&+.stat {
		margin-left: 1em;
	}

	.num {
		font-weight: bold;
	}
	.label {
		font-size: 0.9em;
		color: #999;
	}
}

@media all and (min-width: 1280px) {
	body#promo {
		div.heading {
			margin: 10em 0;
		}
	}
}

@media all and (min-width: 1600px) {
	body#promo {
		div.heading {
			margin: 14em 0;
		}
	}
}

@media all and (max-width: 900px) {
	.half-col {
		float: none;
		text-align: center;

		&+.half-col {
			margin-top: 3em;
			margin-left: 0;
		}
	}
	#beta {
		font-size: 1.15em;
	}
}

@media all and (max-width: 600px) {
	#editor, .editor {
		right: 0;
	}
	#preview {
		display: none;
	}
}

@media all and (max-height: 500px) {
	body#promo {
		div.heading {
			margin: 5em 0;
		}
	}
}

@media all and (max-height: 400px) {
	body#promo {
		div.heading {
			margin: 0em 0;
		}
	}
}

/* Smartphones (portrait and landscape) ----------- */
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
	header {
		.opacity(1);
	}
}

/* Smartphones (portrait) ----------- */
@media only screen and (max-width : 320px) {
	header {
		.opacity(1);
	}
}

/* iPads (portrait and landscape) ----------- */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
	header {
		.opacity(1);
	}
}
